package com.linkage.lcims.base.po.business;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Set;
import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.ToStringBuilder;


/** 
 *        @hibernate.class
 *         table="BD_TOLL_ATTR_POLICY"
 *     
*/
@SuppressWarnings("serial")
public class BdTollAttrPolicy implements Serializable {

    /** identifier field */
    private com.linkage.lcims.base.po.business.BdTollAttrPolicyPK comp_id;

    /** persistent field */
    private BigDecimal priority;

    /** persistent field */
    private BigDecimal calculateby;

    /** persistent field */
    private BigDecimal billingcycle;

    /** persistent field */
    private BigDecimal accounttype;

    /** nullable persistent field */
    private BigDecimal freelength;

    /** nullable persistent field */
    private BigDecimal freemonth;

    /** nullable persistent field */
    private String description;

    /** nullable persistent field */
    private com.linkage.lcims.base.po.business.BdTollPolicy bdTollPolicy;

    /** persistent field */
    private Set<BdTollPolicySuit> bdTollPolicySuits;

    /** persistent field */
    private Set<BdTollPolicyAttr> bdTollPolicyAttrs;

    /** full constructor */
    public BdTollAttrPolicy(com.linkage.lcims.base.po.business.BdTollAttrPolicyPK comp_id, BigDecimal priority, BigDecimal calculateby, BigDecimal billingcycle, BigDecimal accounttype, BigDecimal freelength, BigDecimal freemonth, String description, com.linkage.lcims.base.po.business.BdTollPolicy bdTollPolicy, Set<BdTollPolicySuit> bdTollPolicySuits, Set<BdTollPolicyAttr> bdTollPolicyAttrs) {
        this.comp_id = comp_id;
        this.priority = priority;
        this.calculateby = calculateby;
        this.billingcycle = billingcycle;
        this.accounttype = accounttype;
        this.freelength = freelength;
        this.freemonth = freemonth;
        this.description = description;
        this.bdTollPolicy = bdTollPolicy;
        this.bdTollPolicySuits = bdTollPolicySuits;
        this.bdTollPolicyAttrs = bdTollPolicyAttrs;
    }

    /** default constructor */
    public BdTollAttrPolicy() {
    }

    /** minimal constructor */
    public BdTollAttrPolicy(com.linkage.lcims.base.po.business.BdTollAttrPolicyPK comp_id, BigDecimal priority, BigDecimal calculateby, BigDecimal billingcycle, BigDecimal accounttype, Set<BdTollPolicySuit> bdTollPolicySuits, Set<BdTollPolicyAttr> bdTollPolicyAttrs) {
        this.comp_id = comp_id;
        this.priority = priority;
        this.calculateby = calculateby;
        this.billingcycle = billingcycle;
        this.accounttype = accounttype;
        this.bdTollPolicySuits = bdTollPolicySuits;
        this.bdTollPolicyAttrs = bdTollPolicyAttrs;
    }

    /** 
     *            @hibernate.id
     *             generator-class="assigned"
     *         
     */
    public com.linkage.lcims.base.po.business.BdTollAttrPolicyPK getComp_id() {
        return this.comp_id;
    }

    public void setComp_id(com.linkage.lcims.base.po.business.BdTollAttrPolicyPK comp_id) {
        this.comp_id = comp_id;
    }

    /** 
     *            @hibernate.property
     *             column="PRIORITY"
     *             length="22"
     *             not-null="true"
     *         
     */
    public BigDecimal getPriority() {
        return this.priority;
    }

    public void setPriority(BigDecimal priority) {
        this.priority = priority;
    }

    /** 
     *            @hibernate.property
     *             column="CALCULATEBY"
     *             length="22"
     *             not-null="true"
     *         
     */
    public BigDecimal getCalculateby() {
        return this.calculateby;
    }

    public void setCalculateby(BigDecimal calculateby) {
        this.calculateby = calculateby;
    }

    /** 
     *            @hibernate.property
     *             column="BILLINGCYCLE"
     *             length="22"
     *             not-null="true"
     *         
     */
    public BigDecimal getBillingcycle() {
        return this.billingcycle;
    }

    public void setBillingcycle(BigDecimal billingcycle) {
        this.billingcycle = billingcycle;
    }

    /** 
     *            @hibernate.property
     *             column="ACCOUNTTYPE"
     *             length="22"
     *             not-null="true"
     *         
     */
    public BigDecimal getAccounttype() {
        return this.accounttype;
    }

    public void setAccounttype(BigDecimal accounttype) {
        this.accounttype = accounttype;
    }

    /** 
     *            @hibernate.property
     *             column="FREELENGTH"
     *             length="22"
     *         
     */
    public BigDecimal getFreelength() {
        return this.freelength;
    }

    public void setFreelength(BigDecimal freelength) {
        this.freelength = freelength;
    }

    /** 
     *            @hibernate.property
     *             column="FREEMONTH"
     *             length="22"
     *         
     */
    public BigDecimal getFreemonth() {
        return this.freemonth;
    }

    public void setFreemonth(BigDecimal freemonth) {
        this.freemonth = freemonth;
    }

    /** 
     *            @hibernate.property
     *             column="DESCRIPTION"
     *             length="100"
     *         
     */
    public String getDescription() {
        return this.description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    /** 
     *            @hibernate.many-to-one
     *             update="false"
     *             insert="false"
     *         
     *            @hibernate.column
     *             name="POLICYID"
     *         
     */
    public com.linkage.lcims.base.po.business.BdTollPolicy getBdTollPolicy() {
        return this.bdTollPolicy;
    }

    public void setBdTollPolicy(com.linkage.lcims.base.po.business.BdTollPolicy bdTollPolicy) {
        this.bdTollPolicy = bdTollPolicy;
    }

    /** 
     *            @hibernate.set
     *             lazy="true"
     *             inverse="true"
     *             cascade="none"
     *            @hibernate.collection-key
     *             column="POLICYID"
     *            @hibernate.collection-key
     *             column="RECORDID"
     *            @hibernate.collection-one-to-many
     *             class="com.linkage.lcims.base.po.business.BdTollPolicySuit"
     *         
     */
    public Set<BdTollPolicySuit> getBdTollPolicySuits() {
        return this.bdTollPolicySuits;
    }

    public void setBdTollPolicySuits(Set<BdTollPolicySuit> bdTollPolicySuits) {
        this.bdTollPolicySuits = bdTollPolicySuits;
    }

    /** 
     *            @hibernate.set
     *             lazy="true"
     *             inverse="true"
     *             cascade="none"
     *            @hibernate.collection-key
     *             column="POLICYID"
     *            @hibernate.collection-key
     *             column="RECORDID"
     *            @hibernate.collection-one-to-many
     *             class="com.linkage.lcims.base.po.business.BdTollPolicyAttr"
     *         
     */
    public Set<BdTollPolicyAttr> getBdTollPolicyAttrs() {
        return this.bdTollPolicyAttrs;
    }

    public void setBdTollPolicyAttrs(Set<BdTollPolicyAttr> bdTollPolicyAttrs) {
        this.bdTollPolicyAttrs = bdTollPolicyAttrs;
    }

    public String toString() {
        return new ToStringBuilder(this)
            .append("comp_id", getComp_id())
            .toString();
    }

    public boolean equals(Object other) {
        if ( (this == other ) ) return true;
        if ( !(other instanceof BdTollAttrPolicy) ) return false;
        BdTollAttrPolicy castOther = (BdTollAttrPolicy) other;
        return new EqualsBuilder()
            .append(this.getComp_id(), castOther.getComp_id())
            .isEquals();
    }

    public int hashCode() {
        return new HashCodeBuilder()
            .append(getComp_id())
            .toHashCode();
    }

}
